<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<jsp:useBean id="boardMgr" class="com.group.board.BoardMgr"/>
<jsp:useBean id="boardBean" class="com.group.board.BoardData"/>
<%
String num = request.getParameter("num");
String spage = request.getParameter("page");
boardMgr.updateReadCnt(num); // 조회수 증가
boardBean = boardMgr.getData(num); //해당 레코드 한 개 읽기

String apass = "****"; //비밀번호 가리기
String admonOk = (String)session.getAttribute("adminOk");
if(admonOk != null){
	if(admonOk.equalsIgnoreCase("admin"))apass = boardBean.getPass();	
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>게시판</title>
<link rel="stylesheet" type="text/css" href="board.css"> <!-- css 삽입-->
</head>
<body topmargin="20" leftmargin="30" bgcolor="beige">
<jsp:include page="../common/top.jsp" />
	<br><br><br>

<table width="500">
	<tr>
		<td>비밀번호 : <b><%=apass %></b></td>
		<td align="right">
			<input type="button" value="새로쓰기" onclick="location.href='boardwrite.jsp'">
			<input type="button" value="수정하기" onclick="location.href='edit.jsp?num=<%=num %>&page=<%=spage %>'">
			<input type="button" value="삭제하기" onclick="location.href='delete.jsp?num=<%=num %>&page=<%=spage %>' ">
			<input type="button" value="목록으로" onclick="location.href='boardlist.jsp?page=<%=spage %>'"/>
		</td>	
	</tr>
</table>
<table width="500" >
	<tr bgcolor="silver" height = "30">
		<td>작성자 : <a href="mailto: <%=boardBean.getMail()%>"><%= boardBean.getName()%></a>(ip:<%=boardBean.getBip() %>)</td>
		<td>작성일 : <%=boardBean.getBdate() %></td>
		<td>조회수 : <%=boardBean.getReadcnt() %></td>
	</tr>
	<tr height="30">
		<td colspan="3" bgcolor="ace7ff">제목 : <%=boardBean.getTitle() %></td>
	</tr>
	<tr>
		<td colspan="3">
			<textarea rows="20" cols="70" style="resize:none;" readonly="readonly"><%=boardBean.getCont()%></textarea>
							<!-- style="resize:none;" txtarea값고정 -->
		</td>
	</tr><hr>
</table>
</body>
</html>